﻿using Lrd.Permissions.Core.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;

namespace Lrd.Permissions.Identity
{
    public abstract class RoleBase<TRoleKey> : EntityBase<TRoleKey>, ICreatedTime
          where TRoleKey : IEquatable<TRoleKey>
    {

        protected RoleBase()
        {

            CreatedTime = DateTime.Now;
        }

        /// <summary>
        /// 获取或设置 角色名称
        /// </summary>
        [Required, DisplayName("角色名称")]
        public string Name { get; set; }

        /// <summary>
        /// 获取或设置 标准化角色名称
        /// </summary>
        [Required, DisplayName("标准化角色名称")]
        public string NormalizedName { get; set; }


        /// <summary>
        /// 获取或设置 一个随机值，每当某个角色被保存到存储区时，该值将发生变化。
        /// </summary>
        [DisplayName("版本标识")]
        public string ConcurrencyStamp { get; set; } = Guid.NewGuid().ToString();

        public DateTime CreatedTime { get; set; }


        public override string ToString()
        {
            return Name;
        }

    }
}
